package constant

import (
	"time"

	gocache "github.com/patrickmn/go-cache"
)

const (
	// jwt负载信息
	JwtKeyUserInfo     = "user"
	JwtKeyUserId       = "userId"
	JwtKeyUserName     = "username"
	JwtKeyUserRoleIds  = "roleIds"
	JwtKeyUserRoleName = "roleName"
	JwtKeyUserDeptIds  = "deptIds"
	JwtKeyUserDeptName = "deptName"
	JwtKeyAgencyId     = "agency"
	JwtKeyAppId        = "appId"
	// 默认分组id
	DefaultGroupId = "root"
	// 匿名分组id
	AnonymousGroupId = "anonymous"
	// 公开分组id
	PublicGroupId = "public-resource"
	// 主题消息地址
	TopicPlaceholder = "$"
	// topic字段sn
	CacheLoginInfo = "cacheLoginInfo"
	CacheDevSn     = "devSn"
	CacheDevType   = "devType"
	CacheSource    = "source"
	CacheTo        = "to"
	CacheAutoLogin = "autoLogin"
	// 自动登录带有model
	CacheModel = "productModel"
	// 历史数据缓存
	HistoryDataQueue = "HISDATA"
	// 设备分组缓存
	DeviceDeptCache = "DEVDEPT"
	// 设备简讯缓存
	DeviceEasyCache = "dev_cache"
	// 事件列表缓存
	DevEventCache = "devEventCache"
	// 已处理消息主题
	HandledMsgTopic = "/san/data/handle"
	LoginMsgTopic   = "/san/event/device/login"
	LogoutMsgTopic  = "/san/event/device/logout"
	// 设备操作消息主题
	DeviceDeleteMsgTopic = "/san/event/device/delete"
	DeviceAddMsgTopic    = "/san/event/device/add"
	// 设备登录顺序队列
	DeviceLoginCacheQueue = "login_data"
	// 已告警条目缓存
	HasAlarmRowCache = "alarm_row"
	// lora网关配置从节点
	LoraSlaveMqttConf = "loraSlaveMq"
	// 设备默认产品编码
	DefaultProductCode = "SS-DEFAULT"
)

var (
	//配置文件
	ConfigFile = "config/settings.yml"
	// 本地缓存
	LocalCache = gocache.New(10*time.Second, 3*time.Second)
	// 子分区历史表
	PartitionHistoryTbs = make([]string, 0)
	// 消费子线程数
	DataRoutineChild = 10
)
